/*
 * Copyright 2014 Semidata. All rights reserved.
 */
package com.semidata.rtd.engine.job;

/**
 * @author shewei@semidata.com, She Wei
 * 
 */
public abstract class SyncTask extends AbstractTask {

	private Exception cause;

	public SyncTask(Job job, long timeout) {
		super(job, timeout);
	}

	@Override
	public void afterExecution(Exception cause) {
		this.cause = cause;
		done();
	}

	@Override
	public Exception getException() {
		return cause;
	}

	public void done() {
		getJob().taskComplete(this);
	}
}
